package spring.analysis2;

import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.core.io.ClassPathResource;

public class BeanFactoryTest {
    @Test
    public void testSimpleLoad() {
        /*
        XmlBeanFactory继承自DefaultListableBeanFactory，在其基础上增加了XMl读取器XmlBeanDefinitionReader（这是个接口吧）
        DefaultListableBeanFactory继承了AbstractAutowireCapableBeanFactory并实现了ConfigurableListableBeanFactory以及BeanDefinitionRegistry接口
         */
        BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("analysis2.xml"));
        MyTestBean myTestBean = (MyTestBean)beanFactory.getBean("myTestBean");
        System.out.println(myTestBean.getTestStr());
        System.out.println();


    }
}



